package node;

public class ListNodeManager {

    public static ListNode createListNodeByArray(int[] nums) {
        ListNode root = new ListNode(0);
        ListNode head = root;
        ListNode tempt = null;
        for (int i : nums) {
            tempt = new ListNode(i);
            root.next = tempt;
            root = root.next;
        }
        return head.next;
    }

    public static void printlnNode(ListNode node){
        System.out.println("==node==");
        while (node != null){
            System.out.print(" "+node.val);
            node = node.next;
        }
    }
}
